const cloud = require('wx-server-sdk');
cloud.init({
  env: cloud.DYNAMIC_CURRENT_ENV
});
db = cloud.database()
// 获取openId云函数入口函数
exports.main = async (event, context) => {
  console.log('event', event)
  console.log('_id', event.articleid)
  console.log('当前人数', event.currentPeople)
  console.log('userList', event.userList)
  return await db.collection('activity').where({
    _id: event.articleid
  }).update({
    data: {
      currentPeople: event.currentPeople,
      userList: event.userList
    }
  })
};